/* tslint:disable */
/* eslint-disable */
/**
 * Admin.NET 通用权限开发平台
 * 让 .NET 开发更简单、更通用、更流行。整合最新技术，模块插件式开发，前后端分离，开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！</font></b></u>
 *
 * OpenAPI spec version: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
import { WarehousePageInput, WarehouseOutput } from '../models/warehouse-page-input';

import { DeleteWarehouseInput, WarehouseInput } from '../models/warehouse-input';
import { AdminResultWarehouse } from '../models/result-pagelist-warehouse';
import { serveConfig } from '../../utils/axios-utils';

// Some imports not used depending on template conditions
// @ts-ignore


/**
 * SysWechatUserApi - axios parameter creator
 * @exports
 */
export const WarehouseApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * 获取仓库档案
         */
        apiWarehousePagePost: async (body?: WarehousePageInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/api/warehouseInfomation/getwarehousePageList`;
            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions: AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options };
            const localVarHeaderParameter = {} as any;

            // 添加认证
            if (configuration && configuration.accessToken) {
                const accessToken = typeof configuration.accessToken === 'function'
                    ? await configuration.accessToken()
                    : await configuration.accessToken;
                localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
            }

            localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
            localVarRequestOptions.headers = { ...localVarHeaderParameter, ...options.headers };
            localVarRequestOptions.data = JSON.stringify(body || {});

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },

        /**
         * 增加仓库档案
        */
        apiWarehouseAddPost: async (body?: WarehouseInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/api/warehouseInfomation/InsertWarehouse`;
            const localVarUrlObj = new URL(localVarPath, serveConfig.basePath);



            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions: AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options };
            const localVarHeaderParameter = {} as any;
            // 添加认证
            if (configuration && configuration.accessToken) {
                const accessToken = typeof configuration.accessToken === 'function'
                    ? await configuration.accessToken()
                    : await configuration.accessToken;
                localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
            }
            localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
            localVarRequestOptions.headers = { ...localVarHeaderParameter, ...options.headers };
            localVarRequestOptions.data = JSON.stringify(body || {});
            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };

        },

        /**
         * 修改仓库档案
         */
        apiWarehouseUpdatePost: async (body?: WarehouseInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/api/warehouseInfomation/UpdateWarehouse`;
            const localVarUrlObj = new URL(localVarPath, serveConfig.basePath);


            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            };
            const localVarRequestOptions: AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options };
            const localVarHeaderParameter = {} as any;
            // 添加认证
            if (configuration && configuration.accessToken) {
                const accessToken = typeof configuration.accessToken === 'function'
                    ? await configuration.accessToken()
                    : await configuration.accessToken;
                localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;

            }
            localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
            localVarRequestOptions.headers = { ...localVarHeaderParameter, ...options.headers };
            localVarRequestOptions.data = JSON.stringify(body || {});
            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };

        },

        /**
         * 删除仓库档案
         */
        apiWarehouseDeletePost: async (body?: DeleteWarehouseInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/api/warehouseInfomation/DeleteWarehouse`;
            const localVarUrlObj = new URL(localVarPath, serveConfig.basePath);


            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            };
            const localVarRequestOptions: AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options };
            const localVarHeaderParameter = {} as any;
            // 添加认证
            if (configuration && configuration.accessToken) {
                const accessToken = typeof configuration.accessToken === 'function'
                    ? await configuration.accessToken()
                    : await configuration.accessToken;
                localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;


            };
            localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
            localVarRequestOptions.headers = { ...localVarHeaderParameter, ...options.headers };
            localVarRequestOptions.data = JSON.stringify(body || {});
            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };


        },

        /**
                 * 
                 * @summary 导出仓库档案 🔖
                 * @param {WarehouseOutput} [body] 
                 * @param {*} [options] Override http request option.
                 * @throws {RequiredError}
                 */
        apiSysLogOpExportPost: async (body?: WarehouseOutput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {

            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarPath = `/api/warehouseInfomation/WarehouseExport`;
            const localVarUrlObj = new URL(localVarPath, serveConfig.basePath);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions: AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options };
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication Bearer required
            // http bearer authentication required
            if (configuration && configuration.accessToken) {
                const accessToken = typeof configuration.accessToken === 'function'
                    ? await configuration.accessToken()
                    : await configuration.accessToken;
                localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
            }

            localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers && localVarRequestOptions.headers['Content-Type'] === 'application/json');
            localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },

    };
}
/**
 * 
 * @param configuration 
 * @returns 
 */
export const apiWarehouseApiFp = function (configuration?: Configuration) {
    return {
        /**
         * 获取仓库档案
         */
        async apiWarehousePagePost(
            body?: WarehousePageInput,
            options?: AxiosRequestConfig
        ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultWarehouse>>> {
            const localVarAxiosArgs = await WarehouseApiAxiosParamCreator(configuration).apiWarehousePagePost(body, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs: AxiosRequestConfig = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
                return axios.request(axiosRequestArgs);
            };
        },

        /**
         * 增加仓库档案
         */
        async apiWarehouseAddPost(
            body?: WarehouseInput,
            options?: AxiosRequestConfig
        ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
            const localVarAxiosArgs = await WarehouseApiAxiosParamCreator(configuration).apiWarehouseAddPost(body, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs: AxiosRequestConfig = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
                return axios.request(axiosRequestArgs);
            };
        },

        /**
         * 修改仓库档案
         */        async apiWarehouseUpdatePost(
            body?: WarehouseInput,
            options?: AxiosRequestConfig
        ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
            const localVarAxiosArgs = await WarehouseApiAxiosParamCreator(configuration).apiWarehouseUpdatePost(body, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs: AxiosRequestConfig = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
                return axios.request(axiosRequestArgs);
            };
        },

        /**
         * 删除仓库档案
         * 
         * 
         */        async apiWarehouseDeletePost(
            id?: DeleteWarehouseInput,
            options?: AxiosRequestConfig
        ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
            const localVarAxiosArgs = await WarehouseApiAxiosParamCreator(configuration).apiWarehouseDeletePost(id, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs: AxiosRequestConfig = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
                return axios.request(axiosRequestArgs);
            };
        },

        /**
                * 
                * @summary 导出操作仓库档案 
                * @param {WarehouseOutput} [body] 
                * @param {*} [options] Override http request option.
                * @throws {RequiredError}
                */
        async apiSysLogOpExportPost(body?: WarehouseOutput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
            const localVarAxiosArgs = await WarehouseApiAxiosParamCreator(configuration).apiSysLogOpExportPost(body, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs: AxiosRequestConfig = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
                return axios.request(axiosRequestArgs);
            };
        },
        // ... existing code ...



    };
};
/**
 * WarehouseApi - object-oriented interface
 * @export
 * @class WarehouseApi
 * @extends {BaseAPI}
 */
export class WarehouseApi extends BaseAPI {
    /**
     * 
     * @summary 获取仓库档案
     * @param {WarehousePageInput} [body] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WarehouseApi
     */
    public async apiWarehousePagePost(body?: WarehousePageInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultWarehouse>> {
        return apiWarehouseApiFp(this.configuration).apiWarehousePagePost(body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary 增加仓库档案
     * @param {WarehouseInput} [body] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WarehouseApi
     */
    public async apiWarehouseAddPost(body?: WarehouseInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
        return apiWarehouseApiFp(this.configuration).apiWarehouseAddPost(body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary 修改仓库档案
     * @param {WarehouseInput} [body] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WarehouseApi
     */
    public async apiWarehouseUpdatePost(body?: WarehouseInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
        return apiWarehouseApiFp(this.configuration).apiWarehouseUpdatePost(body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary 删除仓库档案
     * @param {DeleteWarehouseInput} [body] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WarehouseApi
     */
    public async apiWarehouseDeletePost(body?: DeleteWarehouseInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
        return apiWarehouseApiFp(this.configuration).apiWarehouseDeletePost(body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
    * 
    * @summary 导出仓库档案 🔖
    * @param {WarehouseOutput} [body] 
    * @param {*} [options] Override http request option.
    * @throws {RequiredError}
    * @memberof SysLogOpApi
    */
    public async apiSysLogOpExportPost(body?: WarehouseOutput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
        return apiWarehouseApiFp(this.configuration).apiSysLogOpExportPost(body, options).then((request) => request(this.axios, this.basePath));
    }
}


const BaseUrl=(window as any).__env__.VITE_API_URL
import { axiosInstance } from '/@/utils/axios-utils' 

interface ResponseDate<T=any>{
    code:string,
    message:string,
    result:T
  }
/** 
 * 导入文件操作
 * @param file 导入的文件对象
 * @returns 导入文件操作的响应结果
 */
export function WarehouseinportApi(formData:any) {
  return axiosInstance<ResponseDate>({
    //responseType: 'blob',
    url: BaseUrl + '/api/warehouseInfomation/ImportWarehouse',
    method: 'POST',
    data: formData
  });
}

/** 
 * 下载接口
 * @param data 下载所需参数
 * @returns 下载文件的响应
 */
export function DownloadWarehousePositionApi(params?: Record<string, any>)  {
    return axiosInstance<Blob>({
      responseType: 'blob',
      url: BaseUrl + '/api/warehouseInfomation/DownloadWarehouse',
      method: 'GET',
      params
    });
  }
  /**
   * 批量删除
   */
  export function BatchDeletWarehouseAPi(data:DeleteWarehouseInput[])  {
    return axiosInstance<ResponseDate>({
     // responseType: 'blob',
      url: BaseUrl + '/api/warehouseInfomation/BatchDeleteWarehouse',
      method: 'Delete',
      data
    });
  }
  

  